package com.mspbots.attendance.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.JsonNode;
import com.mspbots.attendance.controller.TenantAttendanceController;
import com.mspbots.attendance.model.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface TenantAttendanceMapper extends BaseMapper<TenantAttendance> {

    List<String> selectTenantUserExtend(TenantAttendance tenantAttendance);

    List<TenantAttendance> selectCurrentDayLog(TenantAttendance tenantAttendance);

    List<String> selectAllTeam(TenantAttendance tenantAttendance);

    List<TenantAttendance> selectByParam(TenantAttendanceController.TenantAttendanceParams params);

    IPage<TenantAttendance> selectByParamPage(Page<TenantAttendance> page, @Param("query") TenantAttendanceController.TenantAttendanceParams params);

    List<TenantAttendance> selectTenantLog(TenantAttendanceController.TenantAttendanceParams params);

    String selectTeamUser(TenantAttendance tenantAttendance);

    List<Users> selectTenantUser(TenantAttendanceController.TenantAttendanceParams params);

    TenantAttendance selectUserTimezone(Long tenantUserId);

    TenantAttendance selectTenantTimezone(Long tenantId);

    Long selectUserMappingByUserId(Long userId);

    TenantUserMapping selectUserMappingBySheetUserId(Map<String, Object> userMappingParam);

    Users selectUserInfo(Long userId);

    String selectUserIdentifier(TenantAttendance att);

    List<TicketInfo> selectUserTickets(AttendanceQueryParam aqp);

    String selectSite(AttendanceQueryParam aqp);

    List<TenantAttendance> findLastIn(long tenantId);

    String selectUserMappingIdentifier(TenantAttendance att);

    List<TenantAttendance> findSubAction(long tenantId);

    Tenant selectTenantInfo(Long tenantId);

    TicketAuditor selectUserAuditor(AttendanceQueryParam aqp);

    List<TenantAttendance> selectTenantUserLog(TenantAttendanceController.TenantAttendanceParams tenantAttendanceParams);

    List<Users> selectTeamsUserInfo(TenantAttendance t);

    TenantAttendance selectLastAttendance(TenantAttendance t);

    List<TicketAuditor> selectSingleUserAuditors(AttendanceQueryParam aqp);

    List<TicketAuditor> selectUserAuditorsList(AttendanceQueryParam aqp);

    List<TicketAuditor> selectUserAuditorsStatus(AttendanceQueryParam aqp);

    JsonNode selectOutCheckTime(Long tenantId);
}
